/*************************************************************************
	> File Name: AbstractFactory.h
	> Author: Joker
	> Mail: mahongtao@foxmail.com 
	> Created Time: 2020-09-21 18:52:42
 ************************************************************************/

#ifndef __ABSTRACTFACTORY_H__
#define __ABSTRACTFACTORY_H__

class AbstractProductA;
class AbstractProductB;

//抽象基类AbstractFactory,工厂的抽象，生产产品A和产品B
class AbstractFactory
{
public:
    AbstractFactory(){}
    virtual ~AbstractFactory(){}
    
    virtual AbstractProductA * CreateProductA() = 0;
    virtual AbstractProductB * CreateProductB() = 0;
};

//派生类ConcreateFactory1,继承自AbstractFactory
//生产产品A和产品B的第一种实现
class ConcreateFactory1
:public AbstractFactory
{
public:
    ConcreateFactory1();
    virtual ~ConcreateFactory1();

    virtual AbstractProductA * CreateProductA() override;
    virtual AbstractProductB * CreateProductB() override;
};

//派生类ConcreateFactory2,继承自AbstractFactory
//生产产品A和产品B的第二种实现
class ConcreateFactory2
:public AbstractFactory
{
public:
    ConcreateFactory2();
    virtual ~ConcreateFactory2();

    virtual AbstractProductA * CreateProductA();
    virtual AbstractProductB * CreateProductB();
};



#endif
